6dofimu28 2.2.0
Loading...
Searching...
No Matches
6dofimu28


6DOF IMU 28 Click

6DOF IMU 28 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : Jul 2025.
  • Type : I2C/SPI type

Software Support

Example Description

This example demonstrates the use of 6DOF IMU 28 Click board by reading and displaying the accelerometer and gyroscope data (X, Y, and Z axis) as well as a temperature measurement in degrees Celsius.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.6DOFIMU28

Example Key Functions

Application Init

Initializes the driver and performs the Click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
c6dofimu28_cfg_t c6dofimu28_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
c6dofimu28_cfg_setup( &c6dofimu28_cfg );
C6DOFIMU28_MAP_MIKROBUS( c6dofimu28_cfg, MIKROBUS_1 );
err_t init_flag = c6dofimu28_init( &c6dofimu28, &c6dofimu28_cfg );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( C6DOFIMU28_ERROR == c6dofimu28_default_cfg ( &c6dofimu28 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
@ C6DOFIMU28_ERROR
Definition c6dofimu28.h:662
#define C6DOFIMU28_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition c6dofimu28.h:550
void application_init(void)
Definition main.c:30

Application Task

Waits for a data ready indication and then reads the accelerometer, gyroscope, and temperature measurements. The results are displayed on the USB UART at 7.5 Hz output data rate.

void application_task ( void )
{
c6dofimu28_data_t meas_data;
if ( c6dofimu28_get_int1_pin ( &c6dofimu28 ) )
{
if ( C6DOFIMU28_OK == c6dofimu28_get_data ( &c6dofimu28, &meas_data ) )
{
log_printf( &logger, " Accel X: %.3f g\r\n", meas_data.accel.x );
log_printf( &logger, " Accel Y: %.3f g\r\n", meas_data.accel.y );
log_printf( &logger, " Accel Z: %.3f g\r\n", meas_data.accel.z );
log_printf( &logger, " Gyro X: %.1f dps\r\n", meas_data.gyro.x );
log_printf( &logger, " Gyro Y: %.1f dps\r\n", meas_data.gyro.y );
log_printf( &logger, " Gyro Z: %.1f dps\r\n", meas_data.gyro.z );
log_printf( &logger, " Temperature: %.2f degC\r\n\n", meas_data.temperature );
}
}
}
@ C6DOFIMU28_OK
Definition c6dofimu28.h:661
void application_task(void)
Definition main.c:67
float y
Definition c6dofimu28.h:638
float x
Definition c6dofimu28.h:637
float z
Definition c6dofimu28.h:639
c6dofimu28_axes_t accel
Definition c6dofimu28.h:649
c6dofimu28_axes_t gyro
Definition c6dofimu28.h:650
float temperature
Definition c6dofimu28.h:651

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.